import java.util.Arrays;

public class Work {
    public static int[][] imageSmoother(int[][] img) {

        int m = img.length - 1;//行
        int n = img[0].length - 1;//列
        int[][] temp = new int[m+1][n+1];
        int sum = 0;
        int i = 0;
        int j = 0;
        for (i = 0; i < m; i++) {
            for (j = 0; j < n; j++) {
                for (int o = i - 1; o <= i + 1; o++) {
                    for (int k = j - 1; k <= j + 1; k++) {
                        if (o >= 0 && k >= 0) {
                            temp[i][j] = img[o][k];
                        }
                    }
                }
            }
        }
        i = 0;
        j = 0;

        for (i = 0; i < m; i++) {
            for (j = 0; j < n; j++) {
                if (i == 1 && j == 1) {
                    temp[i][j] /= 9;
                    if ((i == 0 && j == 1) || (i == 1 && j == 0) || (i == 1 && j == 2) || (i == 2 && j == 1)) {
                        temp[i][j] /= 6;
                    } else {
                        temp[i][j] /= 4;
                    }
                }
            }
        }
        return temp;
    }

    public static void main(String[] args) {
        int[][] arr = new int[3][3];
        for (int i = 0; i <= 2; i++) {
            for (int j = 0; j <= 2; j++) {
                arr[i][j] = 1;
            }
            arr = imageSmoother(arr);
            for (int x = 0; i <= 2; i++) {
                for (int y = 0; y <= 2; y++) {
                    System.out.println(arr[x][y]);
                }
            }

        }
    }
}
